package com.wondertek.poms.service.controller;

import com.wondertek.poms.common.log.MethodLog;
import com.wondertek.poms.common.vo.ResultBean;
import com.wondertek.poms.core.service.IContentFeeService;
import com.wondertek.poms.dao.pojo.ContentFeePojo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**	促销产品配置
 * @author gzx
 */
@RestController
@RequestMapping("con-promotion-fee")
public class ContentBaseController {

	@Autowired
	private IContentFeeService contentFeeService;

	@GetMapping("/find")
	@MethodLog(module = "促销产品配置查询")
	public ResultBean find(String prdContIds,int type) {
		return ResultBean.ok(contentFeeService.findByPomsIdAndType(prdContIds,type));
	}

	@PostMapping("/save")
	@MethodLog(module = "促销产品配置新增", insertDB = true, opterate = 1)
	public ResultBean update(@RequestBody ContentFeePojo contentFeePojo) {
		return contentFeeService.prdSalSave(contentFeePojo);
	}

	@DeleteMapping("/del")
	@MethodLog(module = "促销产品配置删除", insertDB = true, opterate = 3)
	public ResultBean del(String contentFeeIds) {
		return contentFeeService.prdSalDel(contentFeeIds);
	}

}
